package com.lt.flashcard.view;

import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Page;
import org.zkoss.zk.ui.metainfo.ComponentInfo;
import org.zkoss.zk.ui.select.SelectorComposer;

import com.lt.flashcard.Utility;

public class IndexCtrl extends SelectorComposer<Component> {

	private static final long serialVersionUID = 1L;

	@Override
	public ComponentInfo doBeforeCompose(Page page, Component parent, ComponentInfo compInfo) {
		if(Utility.isLogin()) {
			Utility.redirect("dashboard.zul", false);
			return null;
		}
		return super.doBeforeCompose(page, parent, compInfo);
	}
}
